package cn.tedu.task;

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * 测试定时器
 * @author Kiven
 * @date 20220309
 */
@Configuration
public class TestTaskScheduler {

    @Async("taskScheduler")
    @Scheduled(cron="*/5 * * * * ?")
    public void say(){
        System.out.println(Thread.currentThread().getName());
        System.out.println("HelloWorld");
    }
    @Async("taskScheduler")
    @Scheduled(cron="*/5 * * * * ?")
    public void say1(){
        System.out.println(Thread.currentThread().getName());
        System.out.println("HelloWorld1");
    }

}
